package heliotrope.net.loader
{
	import flash.utils.ByteArray;
	import heliotrope.global.ErrorHandler;
	
	public class ByteArrayTarget implements ILoadTarget
	{
		private var _data:ByteArray;
		public function ByteArrayTarget()
		{
		}
		
		public function saveData(data_:Object):void
		{
			CONFIG::debug
			{
				try
				{
					if(!(data_ is ByteArray)) throw new ArgumentError("Wrong data type to save");
					_data = data_ as ByteArray;
				} 
				catch(error:ArgumentError) 
				{
					ErrorHandler.handle(error);
				}
			}

		}

		public function get data():ByteArray
		{
			return _data;
		}

	}
}